package com.pdd.task;

import com.alibaba.fastjson.JSON;
import com.pdd.commons.response.ResponseEntity;
import com.pdd.service.process.impl.DouTuBy52Process;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author:liyangpeng
 * @date:2019/6/3 14:39
 */
@Component
public class DoutuBy52Crawler {

    private Logger logger= LoggerFactory.getLogger(DoutuBy52Crawler.class);

    @Autowired
    private DouTuBy52Process douTuBy52Process;

    @Scheduled(cron = "0 0 12 * * ?")
    private void work(){
        ResponseEntity workResult=douTuBy52Process.startWork();
        logger.info("【表情包-爬虫】52斗图网表情包抓取完毕:{}", JSON.toJSONString(workResult));
    }
}
